export default {
  state: {
    storage_modal: [],
    storage_current_id: 0
  },
  mutations: {
    SET_STORAGE_MODAL: (state, data) => {
      state.storage_modal = []
      state.storage_modal[state.storage_current_id] = data
    },
    SET_STORAGE_CURRENT_ID: (state, data) => {
      state.storage_current_id = data
    }
  },
  actions: {
    showStorageSelect ({ commit }, id) {
      if (id) {
        commit('SET_STORAGE_CURRENT_ID', id)
      }
      commit('SET_STORAGE_MODAL', true)
    },
    hiddenStorageSelect ({ commit }, id) {
      if (id) {
        commit('SET_STORAGE_CURRENT_ID', id)
      }
      commit('SET_STORAGE_MODAL', false)
    },
    setStorageCurrentId ({ commit }, id) {
      commit('SET_STORAGE_CURRENT_ID', id)
    }
  }
}
